home *** CD-ROM | disk | FTP | other *** search
-
- Miscellaneous Code
-
- Copyright 1993 Diana Gruber
-
- This is free source code, and as such, it is worth about what you paid for it.
- It is provided as-is, without any warranties, express or otherwise (whatever
- that means). You may use this code in your own programs with my blessing, and
- if you have any questions or need technical support, give me a call.
-
- Files in the distribution:
- -------------------------
-
- AREAS.EXE -- example of how to use the mouse to detect "hot spots"
- AREAS.C -- source code for areas program
-
- SCROLLTX.EXE -- example of horizontal text scrolling
- SCROLLTX.C -- source code for scrolling program
- SCROLLTX.H -- function declarations
-
- GUI.EXE -- GUI menu program
- GUI.C -- main source code file for menu program
- GUI.H -- function declarations
-
- MENU.C -- menu functions
- MENU.H -- function declarations
-
- CHAR.C -- bitmapped characters, put_string and get_string functions
- CHAR.H -- function declarations
-
- COMMON.C -- code we use a lot -- initialization, termination, etc.
- COMMON.H -- function declarations
-
- DEFS.H -- miscellaneous includes, declares, and defines
-
- MISC.DOC -- this file
-
- WORK -- the file I used with the Microsoft Make utility
-
- FILE_ID.DIZ -- bbs description for sysops
-
- Compiling and linking:
- ---------------------
-
- I compiled AREAS, GUI, and SCROLLTX using the Microsoft C medium model. You
- can use use the following compile commands:
-
- Borland C++ BCC -mm AREAS.C FGM.LIB
- BCC -mm GUI.C COMMON.C CHAR.C MENU.C FGM.LIB
- BCC -mm SCROLLTX.C COMMON.C CHAR.C FGM.LIB
-
- Microsoft C CL /AM AREAS.C /link FGM.LIB /E
- CL /AM GUI.C COMMON.C CHAR.C MENU.C /link FGM.LIB /E
- CL /AM SCROLLTX.C COMMON.C CHAR.C /link FGM.LIB /E
-
- QuickC QCL /AM AREAS.C /link FGM.LIB /E
- QCL /AM GUI.C COMMON.C CHAR.C MENU.C /link FGM.LIB /E
- QCL /AM SCROLLTX.C COMMON.C CHAR.C /link FGM.LIB /E
-
- Turbo C/C++ TCC -mm AREAS.C FGM.LIB
- TCC -mm GUI.C COMMON.C CHAR.C MENU.C FGM.LIB
- TCC -mm SCROLLTX.C COMMON.C CHAR.C FGM.LIB
-
- Zortech C++ ZTC -mm AREAS.C FGM.LIB
- ZTC -mm GUI.C COMMON.C CHAR.C MENU.C FGM.LIB
- ZTC -mm SCROLLTX.C COMMON.C CHAR.C FGM.LIB
-
- All three programs require Fastgraph or Fastgraph/Light to link. If you are
- using Fastgraph/Light, replace the "FGM" with "FGLM".
-
- Functionality:
- -------------
-
- The GUI menu code is similar to that used in the FGDEMO program, but much
- simplified. This program doesn't do anything useful. It just displays the
- pull-down menus with nonsensical messages on them. You can plug in your own
- menu items and functions. This code is intended to be used as a template for
- more sophisticated programs.
-
- The only menu items that work are on the first menu. If you select "load" you
- will get some fields and you can enter file names. I put this code in there
- because people are always asking me how to enter strings in a graphics mode.
- This is how you do it. You will probably want to modify this function for your
- own requirements. There is also a pop-up help screen that works with this
- function. Press F1 to see it. Again, this is a dummy help screen. Create your
- own if you want it to do something useful.
-
- The "shell" function on this menu shells to DOS. Type "exit" to return to the
- menu program.
-
- The "exit" function terminates the program, as does pressing ESC.
-
- The SCROLLTX program scrolls a line of text horizontally in a window. It does
- this by drawing the text 8 times on the hidden page and using fg_transfer to
- transfer the text in sequence to the visual page. Each copy of the text is
- offset by one pixel. We need to do it this way because fg_transfer operates on
- byte boundaries. There are other solutions to the problem of how to scroll
- text horizontally, but this is probably the most efficient solution in terms
- of speed. One pixel horizontal scolling is not terribly fast. The easiest way
- to double the speed is to double the scroll increment. That is, scroll by two
- pixels instead of one. This would also mean you would need half as many copies
- of the text on the hidden page, or 4 copies instead of 8.
-
- The AREAS program draws four rectangles on the screen and displays the mouse
- cursor. When you move the mouse around, it detects the color under the mouse
- and displays a message. The source code stores the mouse areas and function
- calls in structures, which, in my opinion, is the proper approach to this kind
- of problem.
-
- To exit either AREAS or SCROLLTX, press ESC.
-
- Video modes:
- -----------
-
- The GUI menu program runs in mode X (320x240x256). The AREAS program runs in
- standard MCGA (320x200x256). The SCROLLTX program runs in EGA mode 13
- (320x200x16). These programs can be easily adapted to run in just about any
- video mode.
-
- About Fastgraph:
- ---------------
-
- Fastgraph is a programmer's graphics library most commonly used for writing
- games, but useful for other graphics applications as well. For more
- information about Fastgraph, contact:
-
- Ted Gruber Software
- P.O. Box 13408
- Las Vegas, NV 89112
- (702) 735-1980 (voice)
- (702) 735-4603 (fax)
- (702) 796-7134 (bbs)
-
- Other source code files:
- -----------------------
-
- If you liked this source code, you may be interested in the following files
- available on our bbs:
-
- FGDEMO30.ZIP -- Grand tour demo of Fastgraph's functions with source
- code, includes some animation functions
- FGFADE10.ZIP -- Palette fade for 256 color modes
- FGFISH10.ZIP -- A fish tank example, showing a smooth non-destructive
- animation technique
- FGFX10.ZIP -- Fastgraph Effects. Source code for fades and wipes,
- including spirals, curtains, etc.
- FGHEDGE10.ZIP -- Hedge Row, and SVGA maze game with constricted
- mouse support and a recursive maze solution algorithm.
- FGXMAS10.ZIP -- An animated Christmas card with a falling snow effect
-
- These are just a few of the files available on our bulletin board, and we will
- be adding more in the future. Most of these programs were written by me and
- there are also some excellent programs written by other Fastgraph users for
- you to download.